package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="auto_brand" )
public class AutoBrand extends BaseObject implements Serializable {
    private Long brandId;
    private String brandName;
    private String brandUrl;
    private String brandDescription;
    private String brandLogo;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getBrandId() {
        return this.brandId;
    }
    
    public void setBrandId(Long brandId) {
        this.brandId = brandId;
    }
    
    @Column(name="brand_name", nullable=false, length=50)
    public String getBrandName() {
        return this.brandName;
    }
    
    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }
    
    @Column(name="brand_url", nullable=false)
    public String getBrandUrl() {
        return this.brandUrl;
    }
    
    public void setBrandUrl(String brandUrl) {
        this.brandUrl = brandUrl;
    }
    
    @Column(name="brand_description", nullable=false, length=65535)
    public String getBrandDescription() {
        return this.brandDescription;
    }
    
    public void setBrandDescription(String brandDescription) {
        this.brandDescription = brandDescription;
    }
    
    @Column(name="brand_logo", nullable=false)
    public String getBrandLogo() {
        return this.brandLogo;
    }
    
    public void setBrandLogo(String brandLogo) {
        this.brandLogo = brandLogo;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AutoBrand pojo = (AutoBrand) o;

        if (brandName != null ? !brandName.equals(pojo.brandName) : pojo.brandName != null) return false;
        if (brandUrl != null ? !brandUrl.equals(pojo.brandUrl) : pojo.brandUrl != null) return false;
        if (brandDescription != null ? !brandDescription.equals(pojo.brandDescription) : pojo.brandDescription != null) return false;
        if (brandLogo != null ? !brandLogo.equals(pojo.brandLogo) : pojo.brandLogo != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (brandName != null ? brandName.hashCode() : 0);
        result = 31 * result + (brandUrl != null ? brandUrl.hashCode() : 0);
        result = 31 * result + (brandDescription != null ? brandDescription.hashCode() : 0);
        result = 31 * result + (brandLogo != null ? brandLogo.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("brandId").append("='").append(getBrandId()).append("', ");
        sb.append("brandName").append("='").append(getBrandName()).append("', ");
        sb.append("brandUrl").append("='").append(getBrandUrl()).append("', ");
        sb.append("brandDescription").append("='").append(getBrandDescription()).append("', ");
        sb.append("brandLogo").append("='").append(getBrandLogo()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
